<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:p="http://primefaces.org/ui"
                template="/templates/main.xhtml">

    <ui:define name="content">
        <f:metadata>
            <f:event listener="#{historicBean.initHistoricBean()}" type="preRenderView" />
        </f:metadata>

        <h:form id="formHistoric">
            <p:panel id="historicPanel" header="Historico de negociaciones" style="margin-top:10px;">
                <p:dataTable id="historicTable" emptyMessage="No se encontraron negociaciones" value="#{historicBean.historicList}" var="historic">
                    <p:column headerText="N° Negociacion">
                        <h:outputText value="#{historic.negotiationDetail.paymentNumber}"/>
                    </p:column>

                    <p:column headerText="Monto">
                        <h:outputText value="#{historic.negotiationDetail.amount}" >
                            <f:convertNumber currencyCode="CLP" type="currency" currencySymbol="$"/>
                        </h:outputText>
                    </p:column>

                    <p:column headerText="">
                        <h:commandLink value="Ver detalle" action="#{historicBean.loadHistoricDetail(historic.negotiationDetail.paymentNumber)}" />
                    </p:column>
                </p:dataTable>
            </p:panel>
        </h:form>
    </ui:define>

</ui:composition>